<template>
	<view>
		<!-- <web-view src="http://123.56.255.237/#/"></web-view> -->
		<view class="news tn-safe-area-inset-bottom">
			<!-- 顶部自定义导航 -->
			<tn-nav-bar fixed>公众号/网站</tn-nav-bar>
			<view style="margin-top: 200rpx;">
				<u-tag text="长按下方图片进入公众号!!!" type="warning" />
				<view class="erweimaImage">
					<u--image :src="erweimaSrc" width="360px" height="120px"></u--image>
				</view>
				<u-button type="success" @click="wzClick">访问官网</u-button>
			</view>

			<view class='tn-tabbar-height'></view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				erweimaSrc: 'https://www.gsdxjd.com/img/erweima.jpg'
			}
		},
		mounted() {
			// this.getErweima()
		},
		methods: {
			getErweima() {
				let _this = this
				uni.request({
					url: _this.$url + '/index/index/getNewsList',
					method: 'GET',
					data: {
						type: 'ewm',
						row: 10,
						page: 1
					},
					success(res) {
						_this.erweimaSrc = res.data.data.list[0].image
						console.log(_this.erweimaSrc)
					}
				})
			},
			zzhClick() {
				console.log(uni.getSystemInfoSync())
				// 在uniapp中，可以通过uni的API判断当前平台
				// 微信小程序环境中
				wx.navigateToMiniProgram({
					appId: 'wx7d0500e7535be91b', // 公众号的appId
					path: 'https://mp.weixin.qq.com/s?__biz=MzkyNDYyNjYyNw==&mid=2247484666&idx=1&sn=5634bf11850bb5bb530a59bcb340d615&chksm=c1d3bf56f6a436406a75d42e503b1ec035b47fe9a9bd143cd2c4bfdc71904cf1437f17044507#rd', // 跳转到公众号的页面路径
					extraData: {}, // 需要传递给目标公众号的数据
					success(res) {
						// 跳转成功
					},
					fail(err) {
						// 错误处理
					}
				});

			},
			wzClick() {
				let data = 'https://www.gsdxjd.com'
				uni.navigateTo({
					url: '/pages/home/home/webpage/webpage?detail=' + encodeURIComponent(JSON.stringify(data))
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.erweimaImage {
		margin: 25rpx auto;
		display: flex;
		justify-content: center;
	}
</style>